<template>
  <div>
    <van-nav-bar left-text="设置" left-arrow @click-left="onClickLeft" />
    <van-cell is-link @click="$router.push('/my/pwd')">修改密码</van-cell>
    <van-cell is-link @click="userPopup">用户协议</van-cell>
    <van-cell is-link @click="shwPopup">隐私政策</van-cell>
    <van-cell is-link @click="showPopup">退出登录</van-cell>
  </div>
</template>

<script>
import { Dialog,Toast } from "vant";
import storage from "../../utils/Storage"
export default {
  data() {
    return {
      show: false,
      user: false,
      pwd: false,
    };
  },
  methods: {
    showPopup() {
      Dialog.confirm({
        message: "退出后不会删除任何历史数据,确定现在退出吗?",
      
      })
      
        .then(() => {
          storage.remove(storage.KEY_USER)
          if(!storage.get(storage.KEY_USER)){
            Toast({
              message: "退出成功",
              position: "bottom",
              duration: 1000,
            });
            this.$router.push('/sy');
          }
        })
        .catch(() => {
          // on cancel
        });
        
    },
    userPopup() {
      this.user = true;
    }, 
    shwPopup() {
      this.shw = true;
    },
    pwdPopup() {
      this.pwd = true;
    },
    onClickLeft() {
     this.$router.push('/home/my/userc')
    },
   
  },
};
</script>

<style scoped>
.van-nav-bar__content {
  height: 50px;
}
::v-deep .van-nav-bar .van-icon {
  color: black;
}

::v-deep .van-nav-bar__text {
  color: black;
  margin-left: 5px;
}
.van-cell::after {
  border-bottom: 1px solid #ccc;
}
.van-cell {
  height: 50px;
}
.van-cell__value--alone {
  color: #100e0ea5;
  font-size: 15px;
}
.bool {
  width: 200px;
  height: 90px;
  font-size: 12px;
  padding: 20px;
  line-height: 25px;
  color: #686868;
}
.btn {
  position: relative;
  top: 45px;
  right: -20px;
  border: none;
  outline: none;
  background-color: #fff;
  color: red;
  margin-left: 5px;
}
</style>
